

<html>

<head>
	<style>
		* {
			margin: 0px;
			padding: 0px;
			font-size: 16px;
			background-color: white;
		}
		
		#broadcast {
			width: 1300px;
			margin: 200px auto;
		}
		
		.box {
			margin: 0px 10px 0px 0px;
			position: relative;   /*使用层次定位*/
			top: 0px;
			float: left;
		}
		
		.box span {
			padding: 15px 0px 15px 10px;
			border: 1px solid #ddd;
			display: block;
		}
		
		.box a {
			text-decoration: none;
			color: black;
		}
		
		
	</style>

</head>

<body>

	<div id="broadcast">
		<div id="content">
			<div class="box">
				<a href="#"><img src="./pic/1.jpg" /></a>
				<a href="#"><span>投资中最重要的事，你得知道！</span></a>
			</div>
			<div class="box">
				<a href="#"><img src="./pic/2.jpg" /></a>
				<a href="#"><span>（英文课堂）中西双"民"隔空对话</span></a>
			</div>
			<div class="box">
				<a href="#"><img src="./pic/3.jpg" /></a>
				<a href="#"><span>（中文课堂）中西双"民"隔空对话</span></a>
			</div>
			<div class="box">
				<a href="#"><img src="./pic/4.jpg" /></a>
				<a href="#"><span>2021考研备考高分秘籍</span></a>
			</div>
		</div>
	</div>
</body>
<script>

	var boxs = document.getElementsByClassName("box");
	
	for (var i = 0; i < boxs.length; i++) {
		// console.log(boxs[i]);
		
		boxs[i].onmouseover = function (){
			// console.log(this);
			this.style.top = "-20px"; // 距原位置向上偏移20px
		};
		boxs[i].onmouseout = function() {
			this.style.top = "0px";   // 恢复到原位置
		}
	}
	
</script>
</html>